<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%
request.setCharacterEncoding("UTF-8");
String htmlData = request.getParameter("content1") != null ? request.getParameter("content1") : "";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
<head>
<meta charset="utf-8" />
<base href="<%=basePath%>">
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<link rel="stylesheet" type="text/css"	href="<%=basePath %>admin/assets/jquery-easyui-1.4.3/themes/bootstrap/easyui.css">
<link rel="stylesheet" type="text/css" href="<%=basePath %>admin/assets/jquery-easyui-1.4.3/themes/icon.css">
<script type="text/javascript" src="<%=basePath %>admin/assets/jquery-easyui-1.4.3/jquery.min.js"></script>
<script type="text/javascript" src="<%=basePath %>admin/assets/jquery-easyui-1.4.3/jquery.easyui.min.js"></script>
<script type="text/javascript" src="<%=basePath %>admin/assets/jquery-easyui-1.4.3/locale/easyui-lang-zh_CN.js"></script>
<link rel="stylesheet" href="<%=basePath %>admin/assets/css/backOffice/myeasyui_base.css" type="text/css"></link>

<link rel="stylesheet" href="<%=basePath %>admin/assets/kindeditor-4.1.10/themes/default/default.css" />
	<link rel="stylesheet" href="<%=basePath %>admin/assets/kindeditor-4.1.10/plugins/code/prettify.css" />
	<script charset="utf-8" src="<%=basePath %>admin/assets/kindeditor-4.1.10/kindeditor.js"></script>
	<script charset="utf-8" src="<%=basePath %>admin/assets/kindeditor-4.1.10/lang/zh_CN.js"></script>
<!-- 	<script charset="utf-8" src="<%=basePath %>admin/assets/kindeditor-4.1.10/plugins/code/prettify.js"></script> -->
	<script>
       var editor;
		KindEditor.ready(function(K) {
		    var options = {
		        cssPath : '<%=basePath %>admin/assets/kindeditor-4.1.10/plugins/code/prettify.css',
		        items : [
								'source', '|','undo', 'redo', '|', 'preview', 'print', 'template', 'cut', 'copy', 'paste',
								'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
								'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
								'superscript', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '/',
								'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
								'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image', 'multiimage',
								'table', 'hr', 'emoticons', 'baidumap', 'pagebreak', 'anchor', 'link', 'unlink'
						],
				uploadJson : '<%=basePath %>admin/youbiao/news/upload_json.jsp',
				fileManagerJson : '<%=basePath %>admin/youbiao/news/file_manager_json.jsp',
		        filterMode : true
			};
			editor = K.create('textarea[id="form_content"]', options);
			$("#from_submit").click(function(e) {
					$("#form_hidden_content").val(editor.html());
				});
		});
	</script>
	<link rel="stylesheet" type="text/css" href="<%=basePath%>admin/assets/css/backOffice/newsStyle.css">
	<style type="text/css">

#tinybox{position:absolute; display:none; padding:10px; background:#ffffff url(file/img/preload.gif) no-repeat 50% 50%; border:10px solid #e3e3e3; z-index:10000;}
#tinymask{position:absolute; display:none; top:0; left:0; height:100%; width:100%; background:#000000; z-index:9500;}
#tinycontent{background:#ffffff; font-size:1.1em;}


</style>
<body>
    <div class="topTitle">
    	资讯管理
    </div>
    
    <!-- Begin 资讯类别面板 -->
 	<div id="main_layout" class="easyui-layout">
	    <div data-options="region:'center',title:'资讯管理'" style="padding:5px;background:#eee;">
	    	<table class="easyui-datagrid"  id="news" 
				data-options="rownumbers:true,singleSelect:true,url:'admin/news/news_getNewsJson.action',method:'get',toolbar:'#btn_news',pageSize: '20',pageList: [20, 30, 40, 50, 100],pagination:true,onDblClickRow:onDblClickRow,fit:true" >
			<thead>
				<tr>
					<th data-options="field:'newsId',width:100,hidden:true">编号</th>
					<th data-options="field:'categoryName',width:100">类别</th>
					<th data-options="field:'title',fit:'true'">标题</th>
					<th data-options="field:'lunboFlag',width:50,align:'center'" formatter="newsLunboFlagFormatter">类型</th>
					<th data-options="field:'lunboImg',width:50,align:'center'"  formatter="newsLunboFormatter">轮播图</th>
					<th data-options="field:'imgURL',width:50,align:'center'"  formatter="newsSuolveFormatter">缩略图</th>
					<th data-options="field:'status',width:50,align:'center'" formatter="newsStatusFormatter">显示</th>
					<th data-options="field:'summary',width:400">描述</th>
					<th data-options="field:'addTime',width:150,align:'center'"formatter="dateHHmmssFormatter">创建时间</th>
				</tr>
			</thead>
		</table>
		
    </div>
</div>
	<!-- End 资讯类别面板 -->
    
     <!-- Begin 菜单详情操作按钮 -->
    <div id="btn_news" style="height:auto">
    	<div style="margin-bottom:5px">
		<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true" onclick="addNews()">添加</a>
		<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true" onclick="removeNews()">删除</a>
		<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true" onclick="modifyNews()">修改</a>
		</div>
		<div>
			<table style="font-size: 13">
				<tr>
					<td style="text-align: right;">
						类别: 
					</td>
					<td>
						<select class="easyui-combobox"   id="search_category_name"  panelHeight="auto" style="width:150px" >
							<option value="">==请选择==</option>
							<c:forEach items="${newsCategoryList}"  var="category" >
								<option value="${category.id}" >${category.name}</option >
							</c:forEach>
						</select>
					</td>
					<td class="align_right_100">
						类型: 
					</td>
					<td>
						<select class="easyui-combobox"   id="search_lunboFlag"  panelHeight="auto" style="width:150px" >
							<option value="">==请选择==</option>
							<option value="1">轮播</option>
							<option value="0">列表</option>
						</select>
					</td>
					<td class="align_right_100">
						标题: 
					</td>
					<td> 
						<input  class="easyui-textbox" type="text" id="search_title"  data-options="" style="width:150px"></input>
					</td>
					<td class="align_right_100">
						显示:  
					</td>
					<td>
						<select class="easyui-combobox"  id="search_status"   panelHeight="auto" style="width:150px" >
							<option value="">==请选择==</option>
							<option value="1">显示</option>
							<option value="0">隐藏</option>
						</select>
					</td>
					<td>
						<a class="easyui-linkbutton" iconCls="icon-search" onclick="searchNews()">查询</a>
					</td>
				</tr>
			</table>
			<br>
		</div>
	</div>
    <!-- End 菜单详情操作按钮 -->
    
	<!-- Begin 资讯类别表单 -->
	<div id="news_form_dialog" class="easyui-dialog"  style="padding:10px" data-options="modal:true,closed:true,resizable:true,shadow:false">
		<form id="news_form" method="post" enctype="multipart/form-data">
	    	<input type="hidden" id="form_newsId" name="news.newsId" />
	    	<table cellpadding="5">
				<tr>
	    			<td  class="updatePage_75">类别：</td>
	    			<td>
	    				<select class="easyui-combobox"   id="form_category_name" name="news.category.id"  panelHeight="auto" data-options="" required="true">
							<option value="">==请选择==</option>
							<c:forEach items="${newsCategoryList}"  var="category" >
								<option value="${category.id}" >${category.name}</option>
							</c:forEach>
						</select>
	    			</td>
	    			<td  class="updatePage_75" style="text-align: left;"  colspan="2">&nbsp; &nbsp;标题：&nbsp; &nbsp;<input  class="easyui-textbox" style="width: 200" type="text" id="form_title" name="news.title" data-options="validType:'length[1,35]'" required="true" validType="checkNewsValue" ></input></td>
	    		</tr>
	    		<tr>
	    			<td  class="updatePage_75">显示状态：</td>
	    			<td><select class="easyui-combobox"  id="form_status" name="status"  panelHeight="auto" data-options="" required="true">
								<option value="">==请选择==</option>
								<option value="1"> 显示</option>
								<option value="0" >隐藏</option>
							</select>
					</td>
	    			<td  class="fileInput" colspan="2">缩略图：&nbsp; &nbsp;<input type="file" name="suolveImg" id="form_imgURL"/><a id="show_suolveImg"  style="display: none">[查看]</a></td>
	    		</tr>
	    		<tr>
		    		<td class="updatePage_75">展示类型：</td>
		    		<td><select class="easyui-combobox"  id="form_flagStatus" name="lunboFlag"  panelHeight="auto" data-options="" required="true"  >
								<option value="">==请选择==</option>
								<option value="1"> 轮播</option>
								<option value="0" >列表</option>
							</select>
					</td>
					<td id="islunbo" class="fileInput" style="display: none;"  colspan="2">轮播图：&nbsp; &nbsp;<input type="file" name="lunboImg" id="form_lunboImg"/><a id="show_lunboImg"  style="display: none">[查看]</a></td>
				</tr>
<!-- 				<tr id="islunbo" style="display: none"> -->
<!-- 	    			<td class="updatePage_75">轮播图:</td> -->
<!-- 	    			<td><input type="file" name="img" id="form_lunboImg"/></td> -->
<!-- 	    		</tr> -->
	    		<tr>
	    			
	    		</tr>
	    		<tr>
	    			<td  class="updatePage_75">简介：</td>
	    			<td colspan="3"><input class="easyui-textbox" type="text"  id="form_summary" name="news.summary" style="width: 100%"  data-options="validType:'length[1,50]'" required="true"></input></td>
	    		</tr>
	    		<tr>
	    			<td  class="updatePage_75">内容：</td>
	    			<td colspan="3">
	    			<input type="hidden" name="news.content" id="form_hidden_content">
	    				<textarea id="form_content" cols="100" rows="8" style="width:700px;height:200px;visibility:hidden;"></textarea>
<!-- 						<br /> -->
<!-- 						<input type="submit" name="button" value="提交内容" /> (提交快捷键: Ctrl + Enter)</td> -->
	    		</tr>
	    	</table>
	    </form>
	    <div style="text-align:center;padding:5px">
	    	<a href="javascript:void(0)" class="easyui-linkbutton" id="from_submit" onclick="submitDataForm()">提交</a>
	    	<a href="javascript:void(0)" class="easyui-linkbutton" onclick="form_close()">关闭</a>
	    </div>
	</div>
	<!-- End 资讯类别表单 -->
	
	<script type="text/javascript" src="<%=basePath %>admin/assets/js/BackOffice/mine-function.js"></script>
	<script type="text/javascript" src="<%=basePath %>admin/youbiao/news/js/tinybox.js"></script>
	<script type="text/javascript" src="<%=basePath %>admin/youbiao/news/js/js_news.js"></script>
	<script type="text/javascript">
		function tanchupic(src){
			var content = "<img width='auto' height='500' src='"+src+"' />";//弹出图片
		    TINY.box.show(content,0,0,0,0);
		   }
	</script>
</body>
</html>
